<?php

$rows = array( array('编号', '材料名称', '品牌', '规格', '单位', '数量', '单价', '金额', '备注') );
if($indent['items']) {
    $rows[] = array('','','','','','','','日 期',date('Y-m-d H:i', $indent['addtime']));
    $amount = 0; 
    $rows[] = array('供应商:',$indent['supplier'],'','','','','','PO NO.：',$indent['sno']);    
    foreach($indent['items'] as $ware){
            $rows[] = array( 
                            $ware['sno'], 
                            $ware['name'], 
                            $ware['brand'],
                            $ware['specific'],
                            $ware['unit'],
                            $ware['amount'],
                            fnum($ware['price']), 
                            fnum($ware['price']*$ware['amount']), 
                            $ware['remark']
                            );
            $amount += $ware['amount'];
    }
    $rows[] = array('小计','','','','',$amount,'',$indent['total'],'');
    $rows[] = array('采购经办人:',$indent['user_name'],'','','','','','','');

}
Exporter::csv($rows, '采购订单明细');

?>
